In conventional, in Japanese Unexamined Patent Publication No. 2002-48247, there has been developed a structure in which a magnetic encoder 106 is integrally formed in a sealing device 105 sealing an annular space between a shaft 101 and a housing 102 which rotate relatively to each other via a rolling element 103, as shown in FIG. 7. The sealing device 105 is structured such that first and second annular members 107 and 108 each of which is formed in an L-shaped cross sectional shape are fitly attached to the shaft 101 and the housing 102 respectively, a seal member 109 is provided in the second annular member 108, and a seal lip 110 integrally formed with the seal member 109 is brought into contact with the first annular member 107 with sealing effect, thereby preventing a foreign material from entering from the external and preventing a grease in the inside from flowing out. The magnetic encoder 106 is formed by an elastic body such as a rubber, a resin or the like into which a magnetic material powder is mixed, and is vulcanized and adhered to an outer surface (right side in the drawing) of a flange portion of the first seal annular member 107. The magnetic encoder 106 is structured such that magnetic poles are alternately formed in the circumferential direction by a magnetic field applied from the external, and a rotating speed or the like is detected by sensing a change of the magnetic field generated from the rotating magnetic encoder 106 by means of a magnetic sensor 111 arranged close thereto.
In accordance with this structure, since the magnetic encoder 106 and the magnetic sensor 111 are arranged in an outermost position in the axial direction which is exposed to the atmospheric air, the magnetic encoder 106 and the magnetic sensor 111 are directly exposed to splashing muddy water and a foreign material, and are under the condition of being easily affected by a disturbance such as a magnetic field applied from the external. Accordingly, reduction of the magnetic force and turbulence of the magnetic force are generated, and they are under the condition of hardly to supplying stable magnetic force. Further, if a foreign material intrudes so as to attach to a portion between the magnetic encoder 106 and the magnetic sensor 111, the magnetic encoder 106 and the magnetic sensor 111 are damaged due to the foreign material bitten by them with rotational force in the worst case and there is a risk that a detecting number of the rotation is led into error.
As a countermeasure thereof, in Japanese Unexamined Patent Publication No. 11-303879, there is employed a method of wrapping the magnetic encoder 106 by a protection plate 113 arranged in the outside in the axial direction of the magnetic encoder 106 so as to protect the magnetic encoder 106, as shown in FIG. 8. However, since the protecting plate 113 is newly provided, a number of parts and an assembling man-hour are increased. Further, since a setting space must be enlarged in the axial direction, it is hard to attach to a narrow space.